package com.xiaxiang.xiawan.login;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;

import com.umeng.socialize.Config;
import com.umeng.socialize.UMShareAPI;
import com.umeng.socialize.common.QueuedWork;
import com.xiaxiang.xiawan.R;

/**
 * Created by Administrator on 2017-10-18.
 */

public class XXLoginActivity extends Activity {
    private View mainView;
    private XXClientLogin mDGClientLogin;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,  WindowManager.LayoutParams.FLAG_FULLSCREEN);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        super.onCreate(savedInstanceState);
        Config.DEBUG = true;
        QueuedWork.isUseThreadPool = false;
        UMShareAPI.get(this);
        LayoutInflater inflater = LayoutInflater.from(this);
        mainView = inflater.inflate(R.layout.act_login_layout,null);
        setContentView(mainView);
        mDGClientLogin = new XXClientLogin(this,mainView);
    }



    @Override
    protected void onStart() {
        super.onStart();
        if(mDGClientLogin != null){
            mDGClientLogin.onStart();
        }
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        if(mDGClientLogin != null) {
            mDGClientLogin.onDestroy();
        }
    }

    @Override
    protected void onStop() {
        super.onStop();
        if(mDGClientLogin != null) {
            mDGClientLogin.onStop();
        }
    }

    @Override
    protected void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
        if(mDGClientLogin != null) {
            mDGClientLogin.onSaveInstanceState(outState);
        }
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if(mDGClientLogin != null) {
            mDGClientLogin.onActivityResult(requestCode, resultCode, data);
        }
    }
}
